package domotica.scontrol.rcp.gui.input;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;

import domotica.scontrol.rcp.system.StartUpSControl;

public class InputHandler implements IWorkbenchWindowActionDelegate {
	
	@Override
	public void run(IAction action) {
		
		if(action.getId().equals("startSControl")) {
			System.out.println("Starting SControl...");
			StartUpSControl.getSControl().start();
		} 
		else if(action.getId().equals("stopSControl")) {
			StartUpSControl.getSControl().stop();
			StartUpSControl.reset();
			System.out.println("SControl stopped");
		}
	}

	@Override
	public void selectionChanged(IAction action, ISelection selection) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void init(IWorkbenchWindow window) {
		// TODO Auto-generated method stub
		
	}

}
